#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
void fun(int (*s)[4], int* a, int mm, int nn)
{
	int k = 0;
	for(int i=0;i<mm;i++)
		for (int j = 0; j < nn; j++)
		{
			a[k] = s[i][j];
			k++;
		}
}
int main()
{
	int a[3][4] = { {1,2,3,4},{5,6,7,8},{9,10,11,12} };
	int b[12];
	fun(a, b, 3, 4);
	for (int i = 0; i < 12; i++)
		cout << b[i] << " ";
	cout << endl;
	return 0;
}